package ControlPanel;

import java.util.Scanner;

import Component.Engine.HydrogenFuelEngine;
import Factory.FinalAssemblyFactory.EletricCarProduce;
import Factory.FinalAssemblyFactory.OilCarProduce;
import car.EletricCar;
import car.OilCar;


public class ControlPanel {
    public void start(){
        
        System.out.println("-----欢迎进入汽车制造工厂-----");
        System.out.println("\t [By彭京伟]");
        System.out.println("\t202152100327");
        
        mainmenu();
        Scanner scan=new Scanner(System.in);
        
        int selection=scan.nextInt();
        
        while(true){
            if(selection==5) {
                System.out.println("再见");
                break;
            }
            else if(selection==1){
                OilCarProduce indent=new OilCarProduce();
                OilCar car =indent.makeOilCar();
                car.standby();
            }
            else if(selection==2){
                EletricCarProduce indent=new EletricCarProduce();
                EletricCar car =indent.makeEletricCar();
                car.standby();
            }
            else if(selection==3){
               System.out.println("燃油汽车工厂减少燃油机车产量\n电动汽车工厂增加电动机车产量");
            }
            else if(selection==4){
                System.out.println("[尝试开发氢燃料引擎]");
                HydrogenFuelEngine newengine = new HydrogenFuelEngine();
                newengine.working();
            }
            
            mainmenu();
            selection=scan.nextInt();
        }

    }

    private void mainmenu() {
        System.out.println("请选择操作序号：");
        System.out.println("[1]:制造一辆[燃油汽车]\n[2]:制造一辆电动汽车\n[3]:节能减排\n[4]:实验室\n[5]:退出");
    }

}
